<template>
  <div>
    <h2>AppChild2.vue</h2>
  </div>
</template>
<script setup>
import { onMounted,onBeforeUnmount } from 'vue';
import bus from "../assets/bus.js"
// 向兄弟组件传参


onMounted(() => {
  bus.on('ccc', (e) => {
    console.log("接收的ccc",e)
  });
  // EventBus.all
  bus.on("*", (type, e) => {
    console.log("接收的*",type, e)
  })
})
onBeforeUnmount(() => {
  console.log("开始清空");
  // bus.all.clear();
  // bus.off(['ccc'])
  bus.off('ccc')
})
</script>
<style lang="scss" scoped></style>